W3_POP3_Disconnect(w3);
}
-void login_handler(struct W3* w3){
+void login_handler(struct W3* w3) {
printf("Logged in\n");
W3_Set_Method(w3, "LIST");
W3_POP3_Send_Request(w3);
int main(int argc, char** argv) {
if(argc < 4) {
+ fprintf(stderr, "%s: usage: %s hostname username password\n", argv[0], argv[0]);
return 1;
}
W3_Library_Init();
char c = buf[i];
if(c == '\r') continue;
bool newl = false;
- if(c == '\n' && newl_cond){
+ if(c == '\n' && newl_cond) {
newl = true;
- }else if(c == '.' && !newl_cond){
+ } else if(c == '.' && !newl_cond) {
newl_cond = true;
}
if(newl) {
void W3_POP3_Set_Password(struct W3* w3, const char* password) { __W3_Add_Prop(w3, "POP3_PASSWORD", password); }
void W3_POP3_Send_Request(struct W3* w3) {
- if(strcasecmp(w3->method, "LIST") == 0){
+ if(strcasecmp(w3->method, "LIST") == 0) {
*((bool*)w3->generic) = false;
__W3_Auto_Write(w3, "LIST\r\n", 6);
}
}
-void W3_POP3_Disconnect(struct W3* w3){
- __W3_Auto_Write(w3, "QUIT\r\n", 6);
-}
+void W3_POP3_Disconnect(struct W3* w3) { __W3_Auto_Write(w3, "QUIT\r\n", 6); }