File: util.h

package info (click to toggle)
shed 1.15-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 440 kB
  • sloc: ansic: 1,096; sh: 1,010; makefile: 8
file content (43 lines) | stat: -rw-r--r-- 1,303 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
$Id: util.h,v 1.6 2009/01/12 02:45:26 alexsisson Exp $

(C) Copyright 2002-2003 Alex Sisson (alexsisson@gmail.com)

This file is part of shed.

shed is free software; you can redistribute it and/or modify
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

shed is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with shed; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifndef UTIL_H_INCLUDED
#define UTIL_H_INCLUDED

#include <getopt.h>
#include <stdint.h>

/* defines */
#define strequ(s1,s2) (!(strcmp(s1,s2)))

/* ascii control char descs */
extern char  ascii_short_desc[];
extern char *ascii_long_desc[];

/* functions */
char *getascii(unsigned char c, char *s, int mode);
char *getstring(uint64_t n, char *s, int base, int width);
int64_t parsestring(char *s, int base);
int calcwidth(uint64_t n, int base);
char *getopt_makeoptstring(struct option *opt);

#endif