[FFmpeg-devel] [PATCH] Implement the function cmdutils.c:parse_int_or_die

Michael Niedermayer michaelni
Sun Feb 17 18:23:24 CET 2008


On Sun, Feb 17, 2008 at 11:35:27AM +0100, Stefano Sabatini wrote:
> Hi, 
> 
> as in $subject, relevant thread:
> http://thread.gmane.org/alpine.LRH.1.00.0802150032240.23194 at redclaw.mimosa.com
> 
> Best regards.
> -- 
> Stefano Sabatini
> Linux user number 337176 (see http://counter.li.org)

> Index: cmdutils.h
> ===================================================================
> --- cmdutils.h	(revision 11936)
> +++ cmdutils.h	(working copy)
> @@ -89,4 +89,13 @@
>   */
>  void show_license(void);
>  
> +/**
> + * parses a string and returns its corresponding value or exits from
> + * the application if the string cannot be correctly parsed or the
> + * corresponding value is invalid
> + *
> + * @param intstr the string to be parsed
> + */
> +int parse_int_or_die(const char* intstr);


Id prefer
double parse_number_or_die(const char* numstr, int type, double min, double max, const char* error);

d= parse_number_or_die("12234", OPT_INT, 1, 100, "blah blah");


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080217/840c4eea/attachment.pgp>



More information about the ffmpeg-devel mailing list