Add a function to identify a Stream, for user notification.

This commit is contained in:
Vreixo Formoso
2007-12-29 01:58:42 +01:00
parent 5b856cf40b
commit c915c6e3f4
3 changed files with 32 additions and 5 deletions

View File

@ -80,6 +80,13 @@ typedef struct IsoStream_Iface
int (*get_id)(IsoStream *stream, unsigned int *fs_id, dev_t *dev_id,
ino_t *ino_id);
/**
* Get a name that identifies the Stream contents. It is used only for
* informational or debug purposes, so you can return anything you
* consider suitable for identification of the source, such as the path.
*/
char *(*get_name)(IsoStream *stream);
/**
* Free implementation specific data. Should never be called by user.
* Use iso_stream_unref() instead.
@ -134,6 +141,12 @@ int iso_stream_get_id(IsoStream *stream, unsigned int *fs_id, dev_t *dev_id,
return stream->class->get_id(stream, fs_id, dev_id, ino_id);
}
extern inline
char *iso_stream_get_name(IsoStream *stream)
{
return stream->class->get_name(stream);
}
/**
* Create a stream to read from a IsoFileSource.
* The stream will take the ref. to the IsoFileSource, so after a successfully