[BACK]Return to fep_util.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / fep

Diff for /OpenXM_contrib2/fep/fep_util.c between version 1.4 and 1.5

version 1.4, 2019/12/13 15:41:36 version 1.5, 2020/11/01 10:28:22
Line 14  static char rcsid[]=
Line 14  static char rcsid[]=
 #ifndef MKARGDEBUG  #ifndef MKARGDEBUG
   
 #include <stdio.h>  #include <stdio.h>
   #include <stdlib.h>
   #include <unistd.h>
 #include <string.h>  #include <string.h>
 #include <pwd.h>  #include <pwd.h>
 #include <sys/types.h>  #include <sys/types.h>
Line 24  static char rcsid[]=
Line 26  static char rcsid[]=
 #endif  #endif
 #include <ctype.h>  #include <ctype.h>
 #include "fep_defs.h"  #include "fep_defs.h"
   #include "fep_funcs.h"
   
 message(messageString)  void message(char *messageString)
     char *messageString;  
 {  {
     write (2, messageString, strlen (messageString));      write (2, messageString, strlen (messageString));
 }  }
   
 errorBell()  void errorBell()
 {  {
     write (2, "\007", 1);      write (2, "\007", 1);
 }  }
   
 ctlprint(string)  void ctlprint(char *string)
     char *string;  
 {  {
     register char  *cp;      register char  *cp;
   
Line 56  ctlprint(string)
Line 57  ctlprint(string)
 /*  /*
  * Print string using "^" for control characters   * Print string using "^" for control characters
  */   */
 printS (string)  void printS (char *string)
     char *string;  
 {  {
     char *cp;      char *cp;
   
Line 68  printS (string)
Line 68  printS (string)
 /*  /*
  * Check the line is empty or not   * Check the line is empty or not
  */   */
 is_empty_line(line)  int is_empty_line(char *line)
     char *line;  
 {  {
     register char *cp;      register char *cp;
   
Line 84  is_empty_line(line)
Line 83  is_empty_line(line)
 /*  /*
  * Put character using "^" for control characters   * Put character using "^" for control characters
  */   */
 putChar(c)  void putChar(char c)
     char c;  
 {  {
     if (isctlchar(c)) {      if (isctlchar(c)) {
         (void) putchar('^');          (void) putchar('^');
Line 95  putChar(c)
Line 93  putChar(c)
         (void) putchar(c);          (void) putchar(c);
 }  }
   
 char *  char * x_dirname (char *dir)
 x_dirname (dir)  
     char *dir;  
 {  {
     static char dirname [256];      static char dirname [256];
 #if !defined(ANDROID)  #if !defined(ANDROID)
Line 134  x_dirname (dir)
Line 130  x_dirname (dir)
     return (dirname);      return (dirname);
 }  }
   
 DIR *  DIR * x_opendir (char *dir)
 x_opendir (dir)  
     char *dir;  
 {  {
     return (opendir (x_dirname (dir)));      return (opendir (x_dirname (dir)));
 }  }
Line 144  x_opendir (dir)
Line 138  x_opendir (dir)
 /*  /*
  * Strring compare for qsort   * Strring compare for qsort
  */   */
 scmp (a, b)  int scmp (char **a, char **b)
     char **a, **b;  
 {  {
   
     return (strcmp (*a, *b));      return (strcmp (*a, *b));
Line 154  scmp (a, b)
Line 147  scmp (a, b)
 /*  /*
  * Return 1 if "str" is prefixed by "sub"   * Return 1 if "str" is prefixed by "sub"
  */   */
 prefix (sub, str)  int prefix (char *sub, char *str)
     register char *sub, *str;  
 {  {
   
     for (;;) {      for (;;) {
Line 171  prefix (sub, str)
Line 163  prefix (sub, str)
 /*  /*
  * Return 1 if s includes character c   * Return 1 if s includes character c
  */   */
 any (c, s)  int any (int c, char *s)
     register int c;  
     register char *s;  
 {  {
   
     while (*s)      while (*s)
Line 186  any (c, s)
Line 176  any (c, s)
 /*  /*
  * Return maximum number of d1 and d2   * Return maximum number of d1 and d2
  */   */
 max (d1, d2)  int max (int d1, int d2)
     int d1, d2;  
 {  {
     return (d1 > d2 ? d1 : d2);      return (d1 > d2 ? d1 : d2);
 }  }
Line 213  main()
Line 202  main()
 }  }
 #endif /* MKARGDEBUG */  #endif /* MKARGDEBUG */
   
 showArgs (comline)  void showArgs (char *comline)
     char *comline;  
 {  {
     char *argv[MAXARGS];      char *argv[MAXARGS];
     register int c;      register int c;
Line 233  showArgs (comline)
Line 221  showArgs (comline)
     printf ("\n");      printf ("\n");
 }  }
   
 mkargv (s, argv, maxarg)  int mkargv (char *s, char *argv[], int maxarg)
     char *s;  
     char *argv[];  
     int maxarg;  
 {  {
     register char *cp;      register char *cp;
     register int argc = 0;      register int argc = 0;
Line 347  THROUGH:
Line 332  THROUGH:
     return (argc);      return (argc);
 }  }
   
 reverse_strcpy (to, from)  void reverse_strcpy (char *to, char *from)
     register char *to, *from;  
 {  {
     register int len;      register int len;
   
Line 356  reverse_strcpy (to, from)
Line 340  reverse_strcpy (to, from)
         *(to + len) = *(from + len);          *(to + len) = *(from + len);
 }  }
   
 char *search_string (s, lookup)  char *search_string (char *s, char *lookup)
     char *s, *lookup;  
 {  {
     int len = strlen (lookup);      int len = strlen (lookup);
     enum {SQUOTE, DQUOTE, NORMAL} status = NORMAL;      enum {SQUOTE, DQUOTE, NORMAL} status = NORMAL;
Line 394  char *search_string (s, lookup)
Line 377  char *search_string (s, lookup)
  * It is assumed that first byte of strint s can't be second byte of KANJI   * It is assumed that first byte of strint s can't be second byte of KANJI
  * code.   * code.
  */   */
 iskanji_in_string (s, i)  int iskanji_in_string (char *s, int i)
     char *s;  
     int i;  
 {  {
     register char *cp = s, *target = s + i;      register char *cp = s, *target = s + i;
   

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>