Displaying 20 results from an estimated 37 matches for "g_str_has_prefix".
2016 Aug 01
1
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...gt; + char *buf, size_t sz,
> > > + struct virtio_pstore_fileinfo *info)
> > > +{
> > > + snprintf(buf, sz, "%s/%s", s->directory, name);
> > > +
> > > + if (g_str_has_prefix(name, "dmesg-")) {
> > > + info->type = VIRTIO_PSTORE_TYPE_DMESG;
> > > + name += strlen("dmesg-");
> > > + } else if (g_str_has_prefix(name, "console-")) {
> > > + info->type = VIRTIO_PSTORE_TYPE_CONSOL...
2016 Aug 01
1
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...gt; + char *buf, size_t sz,
> > > + struct virtio_pstore_fileinfo *info)
> > > +{
> > > + snprintf(buf, sz, "%s/%s", s->directory, name);
> > > +
> > > + if (g_str_has_prefix(name, "dmesg-")) {
> > > + info->type = VIRTIO_PSTORE_TYPE_DMESG;
> > > + name += strlen("dmesg-");
> > > + } else if (g_str_has_prefix(name, "console-")) {
> > > + info->type = VIRTIO_PSTORE_TYPE_CONSOL...
2016 Jul 28
2
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...store_from_filename(VirtIOPstore *s, char *name,
> + char *buf, size_t sz,
> + struct virtio_pstore_fileinfo *info)
> +{
> + snprintf(buf, sz, "%s/%s", s->directory, name);
> +
> + if (g_str_has_prefix(name, "dmesg-")) {
> + info->type = VIRTIO_PSTORE_TYPE_DMESG;
> + name += strlen("dmesg-");
> + } else if (g_str_has_prefix(name, "console-")) {
> + info->type = VIRTIO_PSTORE_TYPE_CONSOLE;
> + name += strlen("co...
2016 Jul 28
2
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...store_from_filename(VirtIOPstore *s, char *name,
> + char *buf, size_t sz,
> + struct virtio_pstore_fileinfo *info)
> +{
> + snprintf(buf, sz, "%s/%s", s->directory, name);
> +
> + if (g_str_has_prefix(name, "dmesg-")) {
> + info->type = VIRTIO_PSTORE_TYPE_DMESG;
> + name += strlen("dmesg-");
> + } else if (g_str_has_prefix(name, "console-")) {
> + info->type = VIRTIO_PSTORE_TYPE_CONSOLE;
> + name += strlen("co...
2016 Jul 30
0
[Qemu-devel] [PATCH 6/7] qemu: Implement virtio-pstore device
...re *s, char *name,
> > + char *buf, size_t sz,
> > + struct virtio_pstore_fileinfo *info)
> > +{
> > + snprintf(buf, sz, "%s/%s", s->directory, name);
> > +
> > + if (g_str_has_prefix(name, "dmesg-")) {
> > + info->type = VIRTIO_PSTORE_TYPE_DMESG;
> > + name += strlen("dmesg-");
> > + } else if (g_str_has_prefix(name, "console-")) {
> > + info->type = VIRTIO_PSTORE_TYPE_CONSOLE;
> > +...
2007 Jan 26
0
Branch 'interpreter' - libswfdec/swfdec_js.c
...; in swfdec_js_eval
diff --git a/libswfdec/swfdec_js.c b/libswfdec/swfdec_js.c
index 68e89ff..62cf665 100644
--- a/libswfdec/swfdec_js.c
+++ b/libswfdec/swfdec_js.c
@@ -351,13 +351,14 @@ swfdec_js_eval_internal (JSContext *cx,
work = swfdec_js_slash_to_dot (str);
str = work;
}
- if (g_str_has_prefix (str, "this")) {
+ if (obj == NULL && g_str_has_prefix (str, "this")) {
str += 4;
if (*str == '.')
str++;
if (cx->fp == NULL)
goto out;
obj = cx->fp->thisp;
+ cur = OBJECT_TO_JSVAL (obj);
}
while (str != NULL &...
2016 Jul 28
0
[PATCH 6/7] qemu: Implement virtio-pstore device
...irtio_pstore_fileinfo *info)
> > +{
> > + snprintf(buf, sz, "%s/%s", s->directory, name);
>
> if this does not fit, buf will not be 0 terminated and can
> generally be corrupted.
Will change it to use malloc instead.
>
>
> > +
> > + if (g_str_has_prefix(name, "dmesg-")) {
> > + info->type = VIRTIO_PSTORE_TYPE_DMESG;
> > + name += strlen("dmesg-");
> > + } else if (g_str_has_prefix(name, "console-")) {
> > + info->type = VIRTIO_PSTORE_TYPE_CONSOLE;
> > +...
2007 Jun 15
0
Branch 'as' - 4 commits - libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_sprite.c test/trace
...ibswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index be3e877..c3faa96 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -1039,10 +1039,6 @@ swfdec_movie_load (SwfdecMovie *movie, c
}
/* FIXME: what do we do here? Is returning correct?*/
return;
- } else if (g_str_has_prefix (target, "FSCommand:")) {
- const char *command = url + strlen ("FSCommand:");
- SWFDEC_WARNING ("unhandled fscommand: %s %s", command, target);
- return;
}
swfdec_player_launch (player, url, target);
}
diff --git a/libswfdec/swfdec_player.c b/libswfdec...
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...char *filename;
> + unsigned int idx;
> +
> + filename = g_strdup_printf("%s/%s", s->directory, name);
> + if (filename == NULL)
> + return NULL;
> +
> + for (idx = 0; idx < ARRAY_SIZE(virtio_pstore_file_prefix); idx++) {
> + if (g_str_has_prefix(name, virtio_pstore_file_prefix[idx])) {
> + info->type = idx;
> + name += strlen(virtio_pstore_file_prefix[idx]);
> + break;
> + }
> + }
> +
> + if (idx == ARRAY_SIZE(virtio_pstore_file_prefix)) {
> + g_free(filename);...
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...char *filename;
> + unsigned int idx;
> +
> + filename = g_strdup_printf("%s/%s", s->directory, name);
> + if (filename == NULL)
> + return NULL;
> +
> + for (idx = 0; idx < ARRAY_SIZE(virtio_pstore_file_prefix); idx++) {
> + if (g_str_has_prefix(name, virtio_pstore_file_prefix[idx])) {
> + info->type = idx;
> + name += strlen(virtio_pstore_file_prefix[idx]);
> + break;
> + }
> + }
> +
> + if (idx == ARRAY_SIZE(virtio_pstore_file_prefix)) {
> + g_free(filename);...
2016 Jul 28
3
[PATCH 6/7] qemu: Implement virtio-pstore device
...char *buf, size_t sz,
> + struct virtio_pstore_fileinfo *info)
> +{
> + snprintf(buf, sz, "%s/%s", s->directory, name);
if this does not fit, buf will not be 0 terminated and can
generally be corrupted.
> +
> + if (g_str_has_prefix(name, "dmesg-")) {
> + info->type = VIRTIO_PSTORE_TYPE_DMESG;
> + name += strlen("dmesg-");
> + } else if (g_str_has_prefix(name, "console-")) {
> + info->type = VIRTIO_PSTORE_TYPE_CONSOLE;
> + name += strlen("co...
2016 Jul 28
3
[PATCH 6/7] qemu: Implement virtio-pstore device
...char *buf, size_t sz,
> + struct virtio_pstore_fileinfo *info)
> +{
> + snprintf(buf, sz, "%s/%s", s->directory, name);
if this does not fit, buf will not be 0 terminated and can
generally be corrupted.
> +
> + if (g_str_has_prefix(name, "dmesg-")) {
> + info->type = VIRTIO_PSTORE_TYPE_DMESG;
> + name += strlen("dmesg-");
> + } else if (g_str_has_prefix(name, "console-")) {
> + info->type = VIRTIO_PSTORE_TYPE_CONSOLE;
> + name += strlen("co...
2016 Aug 26
0
[PATCH 2/3] qemu: Implement virtio-pstore device
...ned int idx;
> > +
> > + filename = g_strdup_printf("%s/%s", s->directory, name);
> > + if (filename == NULL)
> > + return NULL;
> > +
> > + for (idx = 0; idx < ARRAY_SIZE(virtio_pstore_file_prefix); idx++) {
> > + if (g_str_has_prefix(name, virtio_pstore_file_prefix[idx])) {
> > + info->type = idx;
> > + name += strlen(virtio_pstore_file_prefix[idx]);
> > + break;
> > + }
> > + }
> > +
> > + if (idx == ARRAY_SIZE(virtio_pstore_file_prefix)...
2007 Sep 06
0
3 commits - libswfdec/swfdec_as_date.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite_movie.c
...char *name)
{
GList *walk;
- int i = SWFDEC_AS_CONTEXT (player)->version;
+ int i;
gulong l;
+ guint version = SWFDEC_AS_OBJECT (movie)->context->version;
char *end;
+ SwfdecPlayer *player = SWFDEC_PLAYER (SWFDEC_AS_OBJECT (movie)->context);
- if ((i >= 7 && !g_str_has_prefix (name, "_level")) ||
- strncasecmp (name, "_level", 6) != 0)
- return NULL;
+ if ((version >= 7 && g_str_has_prefix (name, "_level")) ||
+ strncasecmp (name, "_level", 6) == 0) {
+ errno = 0;
+ l = strtoul (name + 6, &end, 1...
2016 Jul 27
0
[PATCH 6/7] qemu: Implement virtio-pstore device
...;);
+}
+
+static void virtio_pstore_from_filename(VirtIOPstore *s, char *name,
+ char *buf, size_t sz,
+ struct virtio_pstore_fileinfo *info)
+{
+ snprintf(buf, sz, "%s/%s", s->directory, name);
+
+ if (g_str_has_prefix(name, "dmesg-")) {
+ info->type = VIRTIO_PSTORE_TYPE_DMESG;
+ name += strlen("dmesg-");
+ } else if (g_str_has_prefix(name, "console-")) {
+ info->type = VIRTIO_PSTORE_TYPE_CONSOLE;
+ name += strlen("console-");
+ } els...
2016 Jul 18
0
[PATCH 2/3] qemu: Implement virtio-pstore device
...sing before
the beginning of the string if the filename is shorter than 6
characters.
> + hdr->flags |= VIRTIO_PSTORE_FL_COMPRESSED;
> + }
> +
> + snprintf(buf, sz, "%s/%s", s->directory, name);
> +
> + if (!strncmp(name, "dmesg-", 6)) {
g_str_has_prefix(name, "dmesg-")
> + hdr->type = cpu_to_le16(VIRTIO_PSTORE_TYPE_DMESG);
> + name += 6;
> + } else if (!strncmp(name, "unknown-", 8)) {
g_str_has_prefix(name, "unknown-")
> + hdr->type = cpu_to_le16(VIRTIO_PSTORE_TYPE_UNKNOWN)...
2016 Jul 18
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...horter than 6
> characters.
Ah, ok.
>
> > + hdr->flags |= VIRTIO_PSTORE_FL_COMPRESSED;
> > + }
> > +
> > + snprintf(buf, sz, "%s/%s", s->directory, name);
> > +
> > + if (!strncmp(name, "dmesg-", 6)) {
>
> g_str_has_prefix(name, "dmesg-")
>
> > + hdr->type = cpu_to_le16(VIRTIO_PSTORE_TYPE_DMESG);
> > + name += 6;
> > + } else if (!strncmp(name, "unknown-", 8)) {
>
> g_str_has_prefix(name, "unknown-")
Will change.
>
> > +...
2016 Jul 18
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...horter than 6
> characters.
Ah, ok.
>
> > + hdr->flags |= VIRTIO_PSTORE_FL_COMPRESSED;
> > + }
> > +
> > + snprintf(buf, sz, "%s/%s", s->directory, name);
> > +
> > + if (!strncmp(name, "dmesg-", 6)) {
>
> g_str_has_prefix(name, "dmesg-")
>
> > + hdr->type = cpu_to_le16(VIRTIO_PSTORE_TYPE_DMESG);
> > + name += 6;
> > + } else if (!strncmp(name, "unknown-", 8)) {
>
> g_str_has_prefix(name, "unknown-")
Will change.
>
> > +...
2016 Jul 27
11
[RFC/PATCHSET 0/7] virtio: Implement virtio pstore device (v2)
Hello,
This is v2 of the virtio-pstore work. In this patchset I addressed
most of feedbacks from previous version. Limiting disk size is not
implemented yet.
* changes in v2)
- update VIRTIO_ID_PSTORE to 22 (Cornelia, Stefan)
- make buffer size configurable (Cornelia)
- support PSTORE_TYPE_CONSOLE (Kees)
- use separate virtqueues for read and write
- support concurrent async
2016 Jul 27
11
[RFC/PATCHSET 0/7] virtio: Implement virtio pstore device (v2)
Hello,
This is v2 of the virtio-pstore work. In this patchset I addressed
most of feedbacks from previous version. Limiting disk size is not
implemented yet.
* changes in v2)
- update VIRTIO_ID_PSTORE to 22 (Cornelia, Stefan)
- make buffer size configurable (Cornelia)
- support PSTORE_TYPE_CONSOLE (Kees)
- use separate virtqueues for read and write
- support concurrent async