]> git.sur5r.net Git - openldap/blobdiff - clients/fax500/faxtotpc.c
Provide a little information about SDF, how to use it, and where to get it.h
[openldap] / clients / fax500 / faxtotpc.c
index d4631b43e6847c753b48c53be47063e61bc37304..797c6fe5a17d68635be651a906bd8a59dff23a35 100644 (file)
  * Routines for parsing the facsimileTelephoneNumber field out of
  * an X.500 entry and converting it to a "tpc.int" domain name.
  *
- * char *faxtotpc(str)
- * char *str;
+ * char *faxtotpc( char *str, char *userinfo)
  *
  * faxtotpc() returns a pointer to a string allocated with malloc(3).
  */
 
+#include "portable.h"
+
 #include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/types.h>
 
-#ifdef ultrix
-extern char *strdup();
-#endif
+#include <ac/ctype.h>
+#include <ac/string.h>
+#include <ac/unistd.h>
 
+#include "fax500.h"
 
 #define        TPCDOMAIN       "tpc.int"
 
 /*
  * Remove everything from 'str' which is not a digit
  */
-void strip_nonnum(str)
-char *str;
+void
+strip_nonnum( char *str )
 {
        char *p, *q;
        p = q = str;
@@ -61,9 +60,8 @@ char *str;
  * Remove anything of the form (blah) where
  * "blah" contains a non-numeric character.
  */
-char *remove_parens(ibuf, obuf)
-char *ibuf;
-char *obuf;
+char *
+remove_parens( char *ibuf, char *obuf )
 {
        char *p = ibuf;
        char *q = obuf;
@@ -132,9 +130,8 @@ char *obuf;
  * 6                  93
  * 8                  99
  */
-char *munge_phone(ibuf, obuf)
-char *ibuf;
-char *obuf;
+char *
+munge_phone( char *ibuf, char *obuf )
 {
 #define        UMAREACODE      "1313"
 
@@ -176,17 +173,11 @@ char *obuf;
 
 
 
-
-
-
-
-
 /* 
  * Convert string to "tpc.int" domain name.
  */
-char *faxtotpc(phone, userinfo)
-char *phone;
-char *userinfo;
+char *
+faxtotpc( char *phone, char *userinfo )
 {
        char *p;
        char *q;
@@ -244,5 +235,4 @@ char *userinfo;
        strcat(obuf, TPCDOMAIN);        /* tack on domain name */
        p = strdup(obuf);
        return(p);
-                               
 }