Lines Matching refs:ptr
161 struct struct_descriptor *ptr,*next; in free_struct_descriptors() local
163 ptr=first_type; in free_struct_descriptors()
164 while (ptr!=NULL) { in free_struct_descriptors()
165 next=ptr->next; in free_struct_descriptors()
166 free_user_commands (&ptr->type_commands); in free_struct_descriptors()
167 free (ptr); in free_struct_descriptors()
168 ptr=next; in free_struct_descriptors()
173 void free_user_commands (struct struct_commands *ptr) in free_user_commands() argument
178 for (i=0;i<=ptr->last_command;i++) { in free_user_commands()
179 free (ptr->names [i]); in free_user_commands()
180 free (ptr->descriptions [i]); in free_user_commands()
183 ptr->last_command=-1; in free_user_commands()
189 struct struct_descriptor *ptr; in add_new_descriptor() local
191 ptr = malloc (sizeof (struct struct_descriptor)); in add_new_descriptor()
192 if (ptr == NULL) { in add_new_descriptor()
196 memset(ptr, 0, sizeof(struct struct_descriptor)); in add_new_descriptor()
197 ptr->prev = ptr->next = NULL; in add_new_descriptor()
198 strcpy (ptr->name,name); in add_new_descriptor()
199 ptr->length=0; in add_new_descriptor()
200 ptr->fields_num=0; in add_new_descriptor()
202 first_type = last_type = ptr; in add_new_descriptor()
204 ptr->prev = last_type; last_type->next = ptr; last_type=ptr; in add_new_descriptor()
206 ptr->type_commands.last_command=-1; in add_new_descriptor()
207 fill_type_commands (ptr); in add_new_descriptor()
208 return (ptr); in add_new_descriptor()
230 void add_new_variable (struct struct_descriptor *ptr,char *v_type,char *v_name) in add_new_variable() argument
237 strcpy (ptr->field_names [ptr->fields_num],v_name); in add_new_variable()
238 ptr->field_positions [ptr->fields_num]=ptr->length; in add_new_variable()
257 ptr->field_lengths [ptr->fields_num] = len; in add_new_variable()
258 ptr->field_types [ptr->fields_num] = field_type; in add_new_variable()
260 ptr->length+=len; in add_new_variable()
261 ptr->fields_num++; in add_new_variable()
264 void fill_type_commands (struct struct_descriptor *ptr) in fill_type_commands() argument
274 if (strcmp ((ptr->name),"file")==0) { in fill_type_commands()
275 add_user_command (&ptr->type_commands,"show","Shows file data",type_file___show); in fill_type_commands()
276 …add_user_command (&ptr->type_commands,"inode","Returns to the inode of the current file",type_file… in fill_type_commands()
277 …add_user_command (&ptr->type_commands,"display","Specifies data format - text or hex",type_file___… in fill_type_commands()
278 add_user_command (&ptr->type_commands,"next","Pass to next byte",type_file___next); in fill_type_commands()
279 add_user_command (&ptr->type_commands,"prev","Pass to the previous byte",type_file___prev); in fill_type_commands()
280 …add_user_command (&ptr->type_commands,"offset","Pass to a specified byte in the current block",typ… in fill_type_commands()
281 …add_user_command (&ptr->type_commands,"nextblock","Pass to next file block",type_file___nextblock); in fill_type_commands()
282 …add_user_command (&ptr->type_commands,"prevblock","Pass to the previous file block",type_file___pr… in fill_type_commands()
283 …add_user_command (&ptr->type_commands,"block","Specify which file block to edit",type_file___block… in fill_type_commands()
284 …add_user_command (&ptr->type_commands,"remember","Saves the file\'s inode position for later refer… in fill_type_commands()
285 add_user_command (&ptr->type_commands,"set","Sets the current byte",type_file___set); in fill_type_commands()
286 …add_user_command (&ptr->type_commands,"writedata","Writes the current block to the disk",type_file… in fill_type_commands()
289 if (strcmp ((ptr->name),"ext2_inode")==0) { in fill_type_commands()
290 add_user_command (&ptr->type_commands,"show","Shows inode data",type_ext2_inode___show); in fill_type_commands()
291 …add_user_command (&ptr->type_commands,"next","Move to next inode in current block group",type_ext2… in fill_type_commands()
292 …add_user_command (&ptr->type_commands,"prev","Move to next inode in current block group",type_ext2… in fill_type_commands()
293 …add_user_command (&ptr->type_commands,"group","Move to the group descriptors of the current inode … in fill_type_commands()
294 …add_user_command (&ptr->type_commands,"entry","Move to a specified entry in the current inode tabl… in fill_type_commands()
295 …add_user_command (&ptr->type_commands,"file","Display file data of the current inode",type_ext2_in… in fill_type_commands()
296 …add_user_command (&ptr->type_commands,"dir","Display directory data of the current inode",type_ext… in fill_type_commands()
299 if (strcmp ((ptr->name),"dir")==0) { in fill_type_commands()
300 add_user_command (&ptr->type_commands,"show","Shows current directory data",type_dir___show); in fill_type_commands()
301 …add_user_command (&ptr->type_commands,"inode","Returns to the inode of the current directory",type… in fill_type_commands()
302 add_user_command (&ptr->type_commands,"next","Pass to the next directory entry",type_dir___next); in fill_type_commands()
303 …add_user_command (&ptr->type_commands,"prev","Pass to the previous directory entry",type_dir___pre… in fill_type_commands()
304 …add_user_command (&ptr->type_commands,"followinode","Follows the inode specified in this directory… in fill_type_commands()
305 …add_user_command (&ptr->type_commands,"remember","Remember the inode of the current directory entr… in fill_type_commands()
306 …add_user_command (&ptr->type_commands,"cd","Changes directory relative to the current directory",t… in fill_type_commands()
307 …add_user_command (&ptr->type_commands,"entry","Moves to a specified entry in the current directory… in fill_type_commands()
308 …add_user_command (&ptr->type_commands,"writedata","Writes the current entry to the disk",type_dir_… in fill_type_commands()
309 …add_user_command (&ptr->type_commands,"set","Changes a variable in the current directory entry",ty… in fill_type_commands()
312 if (strcmp ((ptr->name),"ext2_super_block")==0) { in fill_type_commands()
313 …add_user_command (&ptr->type_commands,"show","Displays the super block data",type_ext2_super_block… in fill_type_commands()
314 …add_user_command (&ptr->type_commands,"gocopy","Move to another backup copy of the superblock",typ… in fill_type_commands()
315 …add_user_command (&ptr->type_commands,"setactivecopy","Copies the current superblock to the main s… in fill_type_commands()
318 if (strcmp ((ptr->name),"ext2_group_desc")==0) { in fill_type_commands()
319 …add_user_command (&ptr->type_commands,"next","Pass to the next block group descriptor",type_ext2_g… in fill_type_commands()
320 …add_user_command (&ptr->type_commands,"prev","Pass to the previous group descriptor",type_ext2_gro… in fill_type_commands()
321 …add_user_command (&ptr->type_commands,"entry","Pass to a specific group descriptor",type_ext2_grou… in fill_type_commands()
322 …add_user_command (&ptr->type_commands,"show","Shows the current group descriptor",type_ext2_group_… in fill_type_commands()
323 …add_user_command (&ptr->type_commands,"inode","Pass to the inode table of the current group block"… in fill_type_commands()
324 …add_user_command (&ptr->type_commands,"gocopy","Move to another backup copy of the group descripto… in fill_type_commands()
325 …add_user_command (&ptr->type_commands,"blockbitmap","Show the block allocation bitmap of the curre… in fill_type_commands()
326 …add_user_command (&ptr->type_commands,"inodebitmap","Show the inode allocation bitmap of the curre… in fill_type_commands()
327 …add_user_command (&ptr->type_commands,"setactivecopy","Copies the current group descriptor to the … in fill_type_commands()
330 if (strcmp ((ptr->name),"block_bitmap")==0) { in fill_type_commands()
331 …add_user_command (&ptr->type_commands,"show","Displays the block allocation bitmap",type_ext2_bloc… in fill_type_commands()
332 …add_user_command (&ptr->type_commands,"entry","Moves to a specific bit",type_ext2_block_bitmap___e… in fill_type_commands()
333 …add_user_command (&ptr->type_commands,"next","Moves to the next bit",type_ext2_block_bitmap___next… in fill_type_commands()
334 …add_user_command (&ptr->type_commands,"prev","Moves to the previous bit",type_ext2_block_bitmap___… in fill_type_commands()
335 …add_user_command (&ptr->type_commands,"allocate","Allocates the current block",type_ext2_block_bit… in fill_type_commands()
336 …add_user_command (&ptr->type_commands,"deallocate","Deallocates the current block",type_ext2_block… in fill_type_commands()
339 if (strcmp ((ptr->name),"inode_bitmap")==0) { in fill_type_commands()
340 …add_user_command (&ptr->type_commands,"show","Displays the inode allocation bitmap",type_ext2_inod… in fill_type_commands()
341 …add_user_command (&ptr->type_commands,"entry","Moves to a specific bit",type_ext2_inode_bitmap___e… in fill_type_commands()
342 …add_user_command (&ptr->type_commands,"next","Moves to the next bit",type_ext2_inode_bitmap___next… in fill_type_commands()
343 …add_user_command (&ptr->type_commands,"prev","Moves to the previous bit",type_ext2_inode_bitmap___… in fill_type_commands()
344 …add_user_command (&ptr->type_commands,"allocate","Allocates the current inode",type_ext2_inode_bit… in fill_type_commands()
345 …add_user_command (&ptr->type_commands,"deallocate","Deallocates the current inode",type_ext2_inode… in fill_type_commands()
350 void add_user_command (struct struct_commands *ptr,char *name,char *description,PF callback) in add_user_command() argument
355 num=ptr->last_command; in add_user_command()
361 ptr->last_command=++num; in add_user_command()
363 ptr->names [num]=(char *) malloc (strlen (name)+1); in add_user_command()
364 strcpy (ptr->names [num],name); in add_user_command()
367 ptr->descriptions [num]=(char *) malloc (strlen (description)+1); in add_user_command()
368 strcpy (ptr->descriptions [num],description); in add_user_command()
371 ptr->callback [num]=callback; in add_user_command()
593 char *ptr; in get_next_option() local
602 ptr=parse_word (buffer,option); in get_next_option()
603 ptr=parse_word (ptr,value); in get_next_option()
611 char *ptr; in check_mounted() local
624 ptr=parse_word (current_line,current_word); in check_mounted()