The affidavit made before the magistrate or district or county attorney is called a “complaint” if it charges the commission of an offense.