repl_entry.c 916 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. #include "slapi-plugin.h"
  13. #include "repl.h"
  14. static int dumping_to_ldif= 0;
  15. static int doing_replica_init= 0;
  16. static char **include_suffix= NULL;
  17. /*
  18. * This is passed the slapd command line arguments.
  19. */
  20. void
  21. repl_entry_init(int argc, char** argv)
  22. {
  23. int i;
  24. for(i=1;i<argc;i++)
  25. {
  26. if(strcmp(argv[i],"db2ldif")==0)
  27. {
  28. dumping_to_ldif= 1;
  29. }
  30. if(strcmp(argv[i],"-r")==0)
  31. {
  32. doing_replica_init= 1;
  33. }
  34. if(strcmp(argv[i],"-s")==0)
  35. {
  36. char *s= slapi_dn_normalize ( slapi_ch_strdup(argv[i+1]) );
  37. charray_add(&include_suffix,s);
  38. i++;
  39. }
  40. }
  41. }