Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~3K People Reached
Favorite Tags
Member Avatar for onus

Here is a small PHP code which I am not clear with. [CODE]/** * Form for configurable Drupal action to beep multiple times */ function beep_multiple_beep_action_form($context) { $form['beeps'] = array( '#type' => 'textfield', '#title' => t('Number of beeps'), '#description' => t('Enter the number of times to beep when this action …

Member Avatar for cereal
0
123
Member Avatar for onus

Hi, here is a simple puzzle to which I have made a program, A C program to take bondectory name as command line argument and print last 3 directories and 3 my_files in all subdirectories without using api 'system' inside it. suppose directory bond0 contains bond1, di2, bond3, bond4, bond5 …

Member Avatar for Trentacle
0
205
Member Avatar for onus

[CODE]#include<dirent.h> #include<stdio.h> #include<stdlib.h> #include<sys/stat.h> int main () { struct dirent **namelist; int i,j; char userd[20]; struct stat statBuf; printf("Enter a directory %s\n",userd); scanf("%s",&userd); printf("the dir is %s\n",*userd); i=scandir(".",&namelist,0,alphasort); printf("enter a directory name %s",*userd); printf("scandir returned i=%d\n",&i); if (i<0) perror("Scandir failed to open directory I hope you understand \n"); else { …

Member Avatar for lvl99
0
383
Member Avatar for onus

I am trying to understand how can I make a graph in C. So I wrote some program. [CODE=c]#include "declarations.h" graph root = NULL; int main() { cgraph(); } void cgraph(void) { int n, choice, dir, count,sib; choice = 1; count = 1; graph priv, temp; printf("Printf we are making …

0
83
Member Avatar for onus

[CODE=c]#include<stdio.h> #include<stdlib.h> #define GREY 1 #define BLACK 0 #define WHITE 2 typedef struct node * graph; typedef struct stack * snode; extern int stack_counter; graph cnode(int data); //cnode is to create a node for graph void cgraph(void); struct node { int data, color; struct node *LEFT, *RIGHT, *TOP, *DOWN; };//this …

Member Avatar for GuitarComet
0
180
Member Avatar for onus

I am trying to understand usage of keyword __attribute in C I have checked following two pages [url]http://unixwiz.net/techtips/gnu-c-attributes.html[/url] and this page also [url]http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Function-Attributes.html[/url] but still I could not understand where do I declare them and how I can use __attribute in my program. To test this I wrote a C …

Member Avatar for sree_ec
0
603
Member Avatar for onus

On this link [url]http://lxr.free-electrons.com/source/drivers/parport/parport_pc.c?v=2.6.29#L97[/url] they defined a structure superio_struct and initialized as [CODE=c]superios[NR_SUPERIOS] = { {0,},};[/CODE] I am not able to understand above initialization has what is it getting initialized to. What I deduce till now is superios is a structure array of struct superio_struct and NR_SUPERIOS is defined as …

Member Avatar for onus
0
106
Member Avatar for onus

On this link [url]http://lxr.ncu.cc/source/kernel/timer.c#094[/url] a return type is defined [CODE] return ((unsigned int)(unsigned long)base & TBASE_DEFERRABLE_FLAG); [/CODE] What is the above function returning.I am not clear with definition of what is being returned in the above code.

Member Avatar for onus
0
159
Member Avatar for onus

[[url]http://lxr.free-electrons.com/source/drivers/net/8139too.c#L498][/url][1] On above link What I am not getting is the structure [CODE] static const struct { const char *name; u32 version; /* from RTL8139C/RTL8139D docs */ u32 flags; } rtl_chip_info[] = { { "RTL-8139", HW_REVID(1, 0, 0, 0, 0, 0, 0), HasHltClk, },[/CODE] gets expanded to [CODE] static const …

0
50
Member Avatar for onus

I have used typedef in my C programs previously many times. So it is not new to me. I was reading through a header file linux-2.6/include/net/iw_handler.h and found following use of typedef [CODE=c]typedef int (*iw_handler)(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra); [/CODE]I was not able to …

Member Avatar for mitrmkar
0
112
Member Avatar for onus

Hi, I am reading and understanding code from a book. I am copy pasting the exact code which I have. Following program is for client.c [code=c] #include<sys/types.h> #include<sys/socket.h> #include <stdio.h> #include <sys/un.h> #include <unistd.h>> #include <stdlib.h> int main() { int sockfd; int len; struct sockaddr_un address; int result; char ch …

Member Avatar for onus
0
150
Member Avatar for onus

I am making a program to do a breadth first search. The code which I am posting here just makes a que of the nodes visited in a binary tree in inorder fashion,so this implementation is not yet complete. While developing I got a segmentation fault which I was not …

Member Avatar for Martin B
0
156
Member Avatar for onus

I am working on a problem (re inventing the wheel for learning) I have a mxn matric (which is my simplified way of saying it is RAM with bytes on it) Some of the locations on this metric is filled with some data and some places are empty. The mxn …

Member Avatar for Banfa
0
142
Member Avatar for onus

I made a binary tree but it has some logic problem can some one point [code=c] #include<stdio.h> #include<stdlib.h> struct node { struct node *left, *right; int data, color; } *root; int check = 0; typedef struct node tree; tree *create_node(int); void add_tree(tree *, tree *); void travel_tree(tree *); int main() …

Member Avatar for onus
0
230
Member Avatar for onus

I wrote a small hello world type of character device driver. When I type echo -n "abcdef" > /dev/bond and do a cat /dev/bond then only last "f" of above input abcdef is displayed rest nothing is displayed. I have experimented many things but I am unable to catch the …

Member Avatar for N1GHTS
0
196
Member Avatar for onus

I am writing a program to reverse a string without using string functions available from standard library. Following code is giving me some error when compiling [code=c] #include<stdio.h> int main () { int i,j; char *p,*s,*g; p="abcdefgt"; i=0;j=0; s=NULL; g=NULL; while (p[i] != '\0') { printf(" %d %c\n",i,p[i]); i++; } …

Member Avatar for N1GHTS
0
515