+#define T_NEWSUPSTR "newsuperior"
+
+
+static void usage LDAP_P(( const char *prog )) LDAP_GCCATTR((noreturn));
+static int process_ldapmod_rec LDAP_P(( char *rbuf ));
+static int process_ldif_rec LDAP_P(( char *rbuf, int count ));
+static void addmodifyop LDAP_P(( LDAPMod ***pmodsp, int modop, char *attr,
+ char *value, int vlen ));
+static int domodify LDAP_P(( char *dn, LDAPMod **pmods, int newentry ));
+static int dodelete LDAP_P(( char *dn ));
+static int domodrdn LDAP_P(( char *dn, char *newrdn, int deleteoldrdn ));
+static int fromfile LDAP_P(( char *path, struct berval *bv ));
+static char *read_one_record LDAP_P(( FILE *fp ));
+
+static void
+usage( const char *prog )
+{
+ fprintf( stderr,
+"Add or modify entries from an LDAP server\n\n"
+"usage: %s [options]\n"
+" The list of desired operations are read from stdin or from the file\n"
+" specified by \"-f file\".\n"
+"options:\n"
+" -a\t\tadd values (default%s)\n"
+" -b\t\tread values from files (for binary attributes)\n"
+" -c\t\tcontinuous operation\n"
+" -d level\tset LDAP debugging level to `level'\n"
+" -D dn\t\tbind DN\n"
+" -E\t\trequest SASL privacy (-EE to make it critical)\n"
+" -f file\t\tperform sequence of operations listed in file\n"
+" -F\t\tforce all changes records to be used\n"
+" -h host\t\tLDAP server\n"
+" -I\t\trequest SASL integrity checking (-II to make it\n"
+" \tcritical)\n"
+" -k\t\tuse Kerberos authentication\n"
+" -K\t\tlike -k, but do only step 1 of the Kerberos bind\n"
+" -M\t\tenable Manage DSA IT control (-MM to make it critical)\n"
+" -n\t\tprint adds, don't actually do them\n"
+" -p port\t\tport on LDAP server\n"
+" -r\t\treplace values\n"
+" -U user\t\tSASL authentication identity (username)\n"
+" -v\t\tverbose mode\n"
+" -w passwd\tbind password (for Simple authentication)\n"
+" -X id\t\tSASL authorization identity (\"dn:<dn>\" or \"u:<user>\")\n"
+" -Y mech\t\tSASL mechanism\n"
+" -Z\t\trequest the use of TLS (-ZZ to make it critical)\n"
+ , prog, (strcmp( prog, "ldapadd" ) ? " is to replace" : "") );
+ exit( EXIT_FAILURE );
+}