stream: Make stream name a constant cstr
We don't deal with the memory for it anyway.
This commit is contained in:
@@ -40,7 +40,7 @@ typedef struct
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
stream_type_t type;
|
stream_type_t type;
|
||||||
char *name;
|
const char *name;
|
||||||
u64 position;
|
u64 position;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
@@ -51,9 +51,9 @@ typedef struct
|
|||||||
|
|
||||||
#define STREAM_DEFAULT_CHUNK 64
|
#define STREAM_DEFAULT_CHUNK 64
|
||||||
|
|
||||||
stream_err_t stream_init_string(stream_t *, char *, sv_t);
|
stream_err_t stream_init_string(stream_t *, const char *, sv_t);
|
||||||
stream_err_t stream_init_pipe(stream_t *, char *, FILE *);
|
stream_err_t stream_init_pipe(stream_t *, const char *, FILE *);
|
||||||
stream_err_t stream_init_file(stream_t *, char *, FILE *);
|
stream_err_t stream_init_file(stream_t *, const char *, FILE *);
|
||||||
void stream_stop(stream_t *);
|
void stream_stop(stream_t *);
|
||||||
|
|
||||||
// End of Content (i.e. we've consumed all cached content/file)
|
// End of Content (i.e. we've consumed all cached content/file)
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ const char *stream_err_to_cstr(stream_err_t err)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stream_err_t stream_init_string(stream_t *stream, char *name, sv_t contents)
|
stream_err_t stream_init_string(stream_t *stream, const char *name,
|
||||||
|
sv_t contents)
|
||||||
{
|
{
|
||||||
if (!stream)
|
if (!stream)
|
||||||
return STREAM_ERR_INVALID_PTR;
|
return STREAM_ERR_INVALID_PTR;
|
||||||
@@ -49,7 +50,7 @@ stream_err_t stream_init_string(stream_t *stream, char *name, sv_t contents)
|
|||||||
return STREAM_ERR_OK;
|
return STREAM_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream_err_t stream_init_pipe(stream_t *stream, char *name, FILE *pipe)
|
stream_err_t stream_init_pipe(stream_t *stream, const char *name, FILE *pipe)
|
||||||
{
|
{
|
||||||
if (!stream)
|
if (!stream)
|
||||||
return STREAM_ERR_INVALID_PTR;
|
return STREAM_ERR_INVALID_PTR;
|
||||||
@@ -68,7 +69,7 @@ stream_err_t stream_init_pipe(stream_t *stream, char *name, FILE *pipe)
|
|||||||
return STREAM_ERR_OK;
|
return STREAM_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream_err_t stream_init_file(stream_t *stream, char *name, FILE *pipe)
|
stream_err_t stream_init_file(stream_t *stream, const char *name, FILE *pipe)
|
||||||
{
|
{
|
||||||
if (!stream)
|
if (!stream)
|
||||||
return STREAM_ERR_INVALID_PTR;
|
return STREAM_ERR_INVALID_PTR;
|
||||||
|
|||||||
Reference in New Issue
Block a user