Advertisement
Guest User

Untitled

a guest
May 24th, 2011
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.65 KB | None | 0 0
  1. ??=include<stdio.h>                                                                                                                                                                                          
  2. ??=include<string.h>
  3. ??=include<stdlib.h>
  4. ??=include<ctype.h>
  5. ??=define __F__ "contactlist.dat"
  6. ??=define xvfz printf
  7. ??=define fxvfz fprintf
  8. ??=define fzvx if
  9. ??=define zfvx else
  10. ??=define vzxf while
  11. ??=define zxfv do
  12. typedef int f;
  13. typedef char z;
  14. f num_rec = 0;
  15. f is_saved = 0;
  16. enum{zoo=31,coo=415,boo=9,woo=26,foo=99,ggg=98,doo=1,moo= 0,_=256};
  17. struct _z{z firstName??(zoo:>; z lastName??(zoo:>; z address??(coo:>; z postalCode??(boo:>; z phoneNumber??(woo:>;
  18.     struct _z *next;};
  19. typedef struct _z __Z;
  20.  
  21. void Menu(void);
  22. void Help(void);
  23. void Add__z(__Z**, __Z**);
  24. void Display__zs(__Z**);
  25. void __zSearch(__Z**);
  26. void Save__zs(__Z**, FILE *);
  27. void Load__zs(__Z**, __Z**, FILE *);
  28. void Delete__z(__Z**);
  29. f isValidNum(z ??(:>, f);
  30. void FormatNum(z ??(:>, f);
  31. void WordCap(z ??(:>, f);
  32.  
  33. int isValidNum(char Number??(:>, int num_t)
  34. {
  35.     int i;
  36.     char errMsg??(:> = "There is an error in your number formating.";
  37.  
  38.     switch(num_t)
  39.     {  
  40.         // If we have a phone number, we just check the length
  41.         case 98:
  42.             if(strlen(Number) > 12)
  43.             {  
  44.                 xvfz("%s\n", errMsg);
  45.                 return moo;
  46.             }  
  47.             break;
  48.         case 99:
  49.             if(strlen(Number) > 7)
  50.             {  
  51.                 xvfz("%s\n", errMsg);
  52.                 return moo;
  53.             }  
  54.             for(i = 0; i < 6; ++i)
  55.             {  
  56.                 if(i % 2 == 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement