0
  *   lY>eJ}@?q1h838_I|+ F    #include <stdio.h>

#include "tsrm_config_common.h"
#include "tsrm_strtok_r.h"

static inline int in_character_class(char ch, const char *delim)
{
	while (*delim) {
		if (*delim == ch) {
			return 1;
		}
		delim++;
	}
	return 0;
}

char *tsrm_strtok_r(char *s, const char *delim, char **last)
{
	char *token;

	if (s == NULL) {
		s = *last;
	}

	while (*s && in_character_class(*s, delim)) {
		s++;
	}
	if (!*s) {
		return NULL;
	}

	token = s;

	while (*s && !in_character_class(*s, delim)) {
		s++;
	}
	if (!*s) {
		*last = s;
	} else {
		*s = '\0';
		*last = s + 1;
	}
	return token;
}

#if 0

main()
{
	char foo[] = "/foo/bar//\\barbara";
	char *last;
	char *token;

	token = tsrm_strtok_r(foo, "/\\", &last);
	while (token) {
		printf ("Token = '%s'\n", token);
		token = tsrm_strtok_r(NULL, "/\\", &last);
	}
	
	return 0;
}

#endif
      li~e8pbѿ0  	   0     	h      	247:0
  "   lY>eJuA3pjbѿiA     # Copyright 2009-2015 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
#   Redistributions of source code must retain the above copyright notice,
#   this list of conditions and the following disclaimer.
#
#   Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from euca2ools.commands.ec2 import EC2Request
from requestbuilder import Arg, Filter, GenericTagFilter
from requestbuilder.exceptions import ArgumentError


class DescribeSnapshots(EC2Request):
    DESCRIPTION = ('Show information about snapshots\n\nBy default, only '
                   'snapshots your account owns and snapshots for which your '
                   'account has explicit restore permissions are shown.')
    ARGS = [Arg('SnapshotId', nargs='*', metavar='SNAPSHOT',
                help='limit results to specific snapshots'),
            Arg('-a', '--all', action='store_true', route_to=None,
                help='describe all snapshots'),
            Arg('-o', '--owner', dest='Owner', metavar='ACCOUNT',
                action='append', default=[],
                help='limit results to snapshots owned by specific accounts'),
            Arg('-r', '--restorable-by', dest='RestorableBy', action='append',
                metavar='ACCOUNT', default=[], help='''limit results to
                snapahots restorable by specific accounts''')]
    FILTERS = [Filter('description', help='snapshot description'),
               Filter('owner-alias', help="snapshot owner's account alias"),
               Filter('owner-id', help="snapshot owner's account ID"),
               Filter('progress', help='snapshot progress, in percentage'),
               Filter('snapshot-id'),
               Filter('start-time', help='snapshot initiation time'),
               Filter('status'),
               Filter('tag-key', help='key of a tag assigned to the snapshot'),
               Filter('tag-value',
                      help='value of a tag assigned to the snapshot'),
               Generic