ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/tools.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/tools.c (file contents):
Revision 1.2 by pajs, Wed Mar 5 12:41:19 2003 UTC vs.
Revision 1.3 by pajs, Fri Mar 7 11:56:44 2003 UTC

# Line 1 | Line 1
1   #include <stdio.h>
2   #include <string.h>
3 + #include <stdlib.h>
4 + #include <sys/types.h>
5 + #include <regex.h>
6  
7   char *f_read_line(FILE *f, const char *string){
8          /* Max line length. 8k should be more than enough */
# Line 12 | Line 15 | char *f_read_line(FILE *f, const char *string){
15          }
16  
17          return NULL;
18 + }
19 +
20 + char *get_string_match(char *line, regmatch_t *match){
21 +        int len=match->rm_eo - match->rm_so;
22 +        char *match_string=malloc(len+1);
23 +
24 +        match_string=strncpy(match_string, line+match->rm_so, len);
25 +        match_string[len]='\0';
26 +
27 +        return match_string;
28 + }
29 +
30 + long long get_ll_match(char *line, regmatch_t *match){
31 +        char *ptr;
32 +        long long num;
33 +
34 +        ptr=line+match->rm_so;
35 +        num=atoll(ptr);
36 +
37 +        return num;
38   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines