Changeset 1658
- Timestamp:
- 07/21/08 00:38:19 (2 months ago)
- Files:
-
- libemu/trunk/include/emu/environment/emu_profile.h (modified) (2 diffs)
- libemu/trunk/src/environment/emu_profile.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libemu/trunk/include/emu/environment/emu_profile.h
r1655 r1658 26 26 *******************************************************************************/ 27 27 28 29 #include <netinet/in.h> 30 #include <arpa/inet.h> 31 #include <sys/types.h> 32 #include <sys/socket.h> 28 33 29 34 #include "emu/emu_list.h" … … 154 159 155 160 void *emu_profile_function_argument_get(struct emu_profile_function *function, int argc); 156 #endif 161 162 void emu_profile_argument_add_sockaddr_ptr(struct emu_profile *profile, const char *name, uint32_t ptr, struct sockaddr sa); 163 164 #endif 165 libemu/trunk/src/environment/emu_profile.c
r1655 r1658 29 29 #include <stdlib.h> 30 30 #include <stdio.h> 31 #include <netinet/in.h> 32 #include <arpa/inet.h> 33 #include <sys/types.h> 34 #include <sys/socket.h> 31 35 32 36 33 37 34 #include "emu/environment/emu_profile.h" 35 36 37 38 38 39 39 /* … … 166 166 167 167 struct emu_profile_argument *argument = emu_profile_argument_new(render_string, argtype, argname); 168 if (value == NULL) 169 value = ""; 168 170 argument->value.tchar = strdup(value); 169 171 emu_profile_argument_add(profile, argument); … … 203 205 } 204 206 207 void emu_profile_argument_add_sockaddr_ptr(struct emu_profile *profile, const char *name, uint32_t ptr, struct sockaddr sa) 208 { 209 210 if ( sa.sa_family == AF_INET ) 211 { 212 struct sockaddr_in *si = (struct sockaddr_in *)&sa; 213 emu_profile_argument_add_ptr(profile, "sockaddr_in *", (char*)name, ptr); 214 emu_profile_argument_struct_start(profile, "", ""); 215 emu_profile_argument_add_short(profile, "short", "sin_family", si->sin_family); 216 emu_profile_argument_add_port(profile, "unsigned short", "sin_port", si->sin_port); 217 emu_profile_argument_struct_start(profile, "in_addr", "sin_addr"); 218 emu_profile_argument_add_ip(profile, "unsigned long", "s_addr", si->sin_addr.s_addr); 219 emu_profile_argument_struct_end(profile); 220 emu_profile_argument_add_string(profile, "char", "sin_zero", " "); 221 emu_profile_argument_struct_end(profile); 222 223 } 224 else 225 { 226 emu_profile_argument_struct_start(profile, "sockaddr *", "name"); 227 emu_profile_argument_struct_end(profile); 228 } 229 230 } 205 231 206 232 struct emu_profile_function *emu_profile_function_new()
