Browse code

- system.methodHelp works now also for core methods (btw: why this ugly mixed case names?)

- core.prints fixed: should check if rpc_scan finished succesfully, before
trying to rpc_add

Andrei Pelinescu-Onciul authored on 16/02/2006 23:40:19
Showing 1 changed files
... ...
@@ -101,12 +101,23 @@ static void system_methodHelp(rpc_t* rpc, void* c)
101 101
 				if (ptr->doc_str && ptr->doc_str[0]) {
102 102
 					rpc->add(c, "s", ptr->doc_str[0]);
103 103
 				} else {
104
-					rpc->add(c, "s", "");
104
+					rpc->add(c, "s", "undocumented");
105 105
 				}
106 106
 				return;
107 107
 			}
108 108
 		}
109 109
 	}
110
+	/* try the core methods too */
111
+	for (ptr=core_rpc_methods;ptr && ptr->name; ptr++){
112
+			if (strcmp(name, ptr->name) == 0) {
113
+				if (ptr->doc_str && ptr->doc_str[0]) {
114
+					rpc->add(c, "s", ptr->doc_str[0]);
115
+				} else {
116
+					rpc->add(c, "s", "undocumented");
117
+				}
118
+				return;
119
+			}
120
+	}
110 121
 }
111 122
 
112 123
 
... ...
@@ -119,8 +130,8 @@ static const char* core_prints_doc[] = {
119 119
 static void core_prints(rpc_t* rpc, void* c)
120 120
 {
121 121
 	char* string = 0;
122
-	rpc->scan(c, "s", &string);
123
-	rpc->add(c, "s", string);
122
+	if (rpc->scan(c, "s", &string)>0)
123
+		rpc->add(c, "s", string);
124 124
 }
125 125
 
126 126