-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.h
39 lines (26 loc) · 1014 Bytes
/
common.h
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
#ifndef COLUMS_UNIQ_COMMON_H
#define COLUMS_UNIQ_COMMON_H
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
extern int Flags;
#define FALSE 0
#define TRUE 1
#define StrLen(str) ((str) ? strlen(str) : 0)
#define Destroy(x) ((x) ? free(x) : 0)
char *CopyStrLen(char *Dest, const char *Src, size_t len);
char *CopyStr(char *Dest, const char *Src);
char *CatStr(char *Dest, const char *Src);
char *CatStrLen(char *Dest, const char *Src, size_t len);
char *MCatStr(char *Dest, const char *Str1, ...);
char *MCopyStr(char *Dest, const char *Str1, ...);
char *AddCharToBuffer(char *Dest, size_t DestLen, char Char);
void ParseCommandValue(int argc, char *argv[], int pos, int Flag, char **String);
void GetMinMaxFields(const char *FieldSpec, int *MinField, int *MaxField);
char *FILEReadLine(char *RetStr, FILE *f, char Term);
void StripTrailingWhitespace(char *str);
void StripCRLF(char *str);
char *FormatStr(char *InBuff, const char *FmtStr, ...);
#endif