Hello, I'm a newbie in C, but i'm trying to make a file to configurate/manipulate variables of a C code.
I tried using int and extern int throught a header or another C code but it doesn't seems to work (even throught the makefile). I also tried (with XML) to put a data structure to hold the shared variables with the XML_SetUserData function to pass a pointer to this structure to the handlers.
Maybe i did something wrong, but i can't find where. Any help is welcome. Thanks.
---------- Post updated at 04:46 PM ---------- Previous update was at 03:41 PM ----------
So,here is code.h
then conf.c
and then code.c
and then the compile
I want to change variable throught code.h or conf.c for code.c but it fail. It seems to ignore it with no errors.
Hi,
I would like to assign a pattern to a variable eg test8* or abc etc
The problem I have is that when I assign the pattern to the variable, if any files within the current directory match the pattern then the variable will be evaluated to equal the filenames rather than the literal pattern.... (3 Replies)
Hi everyone,
Im trying to make a new directory based on a name given in a file called directory_file which contains the following content:
garbage gargbage
Directory: running
more garbage gargbage
more garbage gargbage
more garbage gargbage
So basically i have a shell script that... (3 Replies)
I am evaluating a variable from a database and storing it as inside.
The value of the variable is alpha numeric.How can i make this a string type.Any functions for the same. (1 Reply)
Hi all,
I have a variable say var1 (output from somewhere, which I can't change)which store something like this:
echo $var1
name=fred
age=25
address="123 abc"
password=pass1234
how can I make the variable $name, $age, $address and $password contain the info?
I mean do this in a... (1 Reply)
When script is running you only see when some of the commands are not successfull.
Is there a way to see which command are executed and to show the substitution of variables as every line is executed ? (3 Replies)
I am practicing making my own functions in bash for an upcoming exam. For this example, I want to print out a message and maybe add two numbers. What I would do then is:
bash-3.2$ function practice
{
#code to print
#code to add
}
This would be run using an input file, that would... (1 Reply)
This script is executed whenever a new vehicle is added to the cycle-motor park
of campus. The script asks for the following information about the car and adds a new
line to the vehicle file.txt: name (name of an animal, unique identifier), color, mark,
model, type (e.g., electrical, manual),... (2 Replies)
I'm writing a script that goes something like this:
#!/bin/bash
zenity --list --checklist --title="Choose Packages to Install" --width="1000" --height="400" \
--column="Select" --column="Package Name" --column="Description" \
GIMP=$( " " GIMP "GIMP is a free and open source photo editor." ... (1 Reply)
Discussion started by: Defunct_Lizard
1 Replies
LEARN ABOUT SUSE
mouse_x
mouse_x(3alleg4) Allegro manual mouse_x(3alleg4)NAME
mouse_x, mouse_y, mouse_z, mouse_w, mouse_b, mouse_pos - Global variable with the mouse position/button state. Allegro game programming
library.
SYNOPSIS
#include <allegro.h>
extern volatile int mouse_x;
extern volatile int mouse_y;
extern volatile int mouse_z;
extern volatile int mouse_w;
extern volatile int mouse_b;
extern volatile int mouse_pos;
DESCRIPTION
Global variables containing the current mouse position and button state. Wherever possible these values will be updated asynchronously,
but if mouse_needs_poll() returns TRUE, you must manually call poll_mouse() to update them with the current input state. The `mouse_x' and
`mouse_y' positions are integers ranging from zero to the bottom right corner of the screen. The `mouse_z' and `mouse_w' variables hold the
current vertical and horizontal wheel position, when using an input driver that supports wheel mice. The `mouse_b' variable is a bitfield
indicating the state of each button: bit 0 is the left button, bit 1 the right, and bit 2 the middle button. Additional non standard mouse
buttons might be available as higher bits in this variable. Usage example:
if (mouse_b & 1)
printf("Left button is pressed
");
if (!(mouse_b & 2))
printf("Right button is not pressed
");
The `mouse_pos' variable has the current X coordinate in the upper 16 bits and the Y in the lower 16 bits. This may be useful in tight
polling loops where a mouse interrupt could occur between your reading of the two separate variables, since you can copy this value into a
local variable with a single instruction and then split it up at your leisure. Example:
int pos, x, y;
pos = mouse_pos;
x = pos >> 16;
y = pos & 0x0000ffff;
SEE ALSO install_mouse(3alleg4), poll_mouse(3alleg4), mouse_needs_poll(3alleg4), exalpha(3alleg4), exlights(3alleg4), exmouse(3alleg4),
exshade(3alleg4), exspline(3alleg4), extrans(3alleg4)Allegro version 4.4.2 mouse_x(3alleg4)