#include <string.h>
#include <stdio.h>

#include <config.h>
#include <dboxpath.h>

void mkboxdir(char *boxdir, const char *boxname)
 {
  if(boxname==NULL || boxname[0]==0)
    boxname=config.boxname;

  snprintf(boxdir, DIRLEN, DBOXBOXDIR, config.dboxdir, boxname);
 }

void getboxuserdir(std::string &dest, const std::string &boxdir, const std::string &user)
 {
  dest=boxdir+"user"+DIRCHAR+user+DIRCHAR;
 }

void getboxusermaildir(std::string &dest, const std::string &boxdir, 
                       const std::string &user, const std::string &folder)
 {
  dest=boxdir+"user"+DIRCHAR+user+DIRCHAR+"mfolders"+DIRCHAR+folder+DIRCHAR;
 }

void getboxlogdir(std::string &dest, const std::string &boxdir)
 {
  dest=boxdir+"log"+DIRCHAR;
 }

void getdboxboxdir(std::string &dest, const std::string &dboxdir, const std::string &box)
 {
  dest=dboxdir+box+DIRCHAR;
 }

void getdboxtempdir(std::string &dest, const std::string &dboxdir)
 {
  dest=dboxdir+"temp"+DIRCHAR;
 }

void getdboxsystemdir(std::string &dest, const std::string &dboxdir)
 {
  dest=dboxdir+"system"+DIRCHAR;
 }

void getboxlockdir(std::string &dest, const std::string &boxdir)
 {
  dest=boxdir+"lock"+DIRCHAR;
 }



syntax highlighted by Code2HTML, v. 0.9.1